Skip to main content
Version: 1.0.8

Vowpal Wabbit

VectorZipper

from synapse.ml.vw import *

df = spark.createDataFrame([
("action1_f", "action2_f"),
("action1_f", "action2_f"),
("action1_f", "action2_f"),
("action1_f", "action2_f")
], ["action1", "action2"])

actionOneFeaturizer = (VowpalWabbitFeaturizer()
.setInputCols(["action1"])
.setOutputCol("sequence_one"))

actionTwoFeaturizer = (VowpalWabbitFeaturizer()
.setInputCols(["action2"])
.setOutputCol("sequence_two"))

seqDF = actionTwoFeaturizer.transform(actionOneFeaturizer.transform(df))

vectorZipper = (VectorZipper()
.setInputCols(["sequence_one", "sequence_two"])
.setOutputCol("out"))

vectorZipper.transform(seqDF).show()
Python API: VectorZipperScala API: VectorZipperSource: VectorZipper

VowpalWabbitClassifier

from synapse.ml.vw import *

vw = (VowpalWabbitClassifier()
.setNumBits(10)
.setLearningRate(3.1)
.setPowerT(0)
.setLabelConversion(False))
Python API: VowpalWabbitClassifierScala API: VowpalWabbitClassifierSource: VowpalWabbitClassifier

VowpalWabbitFeaturizer

from synapse.ml.vw import *

featurizer = (VowpalWabbitFeaturizer()
.setStringSplitInputCols(["in"])
.setPreserveOrderNumBits(2)
.setNumBits(18)
.setPrefixStringsWithColumnName(False)
.setOutputCol("features"))
Python API: VowpalWabbitFeaturizerScala API: VowpalWabbitFeaturizerSource: VowpalWabbitFeaturizer

VowpalWabbitInteractions

from synapse.ml.vw import *

interactions = (VowpalWabbitInteractions()
.setInputCols(["v1"])
.setOutputCol("out"))
Python API: VowpalWabbitInteractionsScala API: VowpalWabbitInteractionsSource: VowpalWabbitInteractions